package server;

import java.util.LinkedList;

public class IdList {

	private LinkedList<Long> stack;


	public synchronized LinkedList<Long> getlistStack() {
		LinkedList<Long> ret = new LinkedList<Long>(stack);
		return ret;

	}

	public IdList() {
		this.stack = new LinkedList<Long>();
	}
	
	public synchronized void push(Long l) {
		System.out.println("idlist updated");
		this.stack.add(l);
		System.out.println(stack);
	}

	public synchronized Long pop(int i) {
		return this.stack.get(i);
	}
	public synchronized Long remove(int i) {
		return this.stack.remove(i);
	}

	public synchronized void set(LinkedList<Long> stack) {
		this.stack = stack;
	}

	public synchronized boolean isEmpty() {
		return this.stack.isEmpty();
	}

}
